{extend name="base" /}
<!-- page specific plugin styles -->
{block name="inline-styles"}
<style type="text/css">
    .page, body{
        background-color: #fff;
    }
    .weui-cells_form--login{
        margin-left: 25px;
        margin-right: 25px;
    }
    .weui-cells_form--login input{
        text-align: center;
    }
    /*消除google浏览器黄色框*/
    input:-webkit-autofill,
    input:-webkit-autofill:hover,
    input:-webkit-autofill:focus {
        box-shadow:0 0 0 60px #fff inset;
    }
</style>
{/block}
<!-- PAGE CONTENT BEGINS -->
{block name="content"}
<div class="page js_show">
    <div class="page__hd">
        <div class="weui-panel weui-panel__noafter">
            <div class="weui-panel__bd">
                <img src="/static/mobile/image/bg_login.jpg" width="100%">
            </div>
        </div>
    </div>
    <div class="page__bd_spacing">

        <form class="weui-cells weui-cells_form--login" id="ajaxForm">
            <div class="weui-cell">
                <div class="weui-cell__bd">
                    <input class="weui-input" type="text" name="tel" placeholder="请输入手机号">
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__bd">
                    <input class="weui-input" type="password" name="password" placeholder="不少于6位">
                </div>
            </div>
        </form>

        <div class="weui-btn-area">
            <a class="weui-btn weui-btn_login" href="javascript:;" id="showToast">立即登陆</a>
        </div>

        <div class="weui-cells__tips">温馨提示：初始密码密码为手机号码后六位，登陆成功后请尽快修改密码！<br>为保护您的账户安全和合法权益，请勿将账号密码告知任何第三方机构和个人，对此造成的损失，品正保留解释权。</div>
    </div>

    <div class="page__ft">
        <div class="weui-footer weui-footer_fixed-bottom">
            <p class="weui-footer__links">
                <a href="javascript:void(0);" class="weui-footer__link">@米粒生活</a>
            </p>
            <p class="weui-footer__text">提供全程技术支持</p>
        </div>
    </div>
</div>
{/block}
<!-- PAGE CONTENT ENDS -->
<!-- inline scripts related to this page -->
{block name="related-scripts"}
<script type="text/javascript">
    $("#showToast").click(function(event) {
        /* Act on the event */
        var options={
            url:"/api/v1/member/login",
            type:"POST",
            dataType:"json",
            success: function(json){

                if(json.returnCode==1){
                    $.toast("登陆成功", function() {
                        window.location.href = "{:url('Index/home')}";
                    });
                }else{
                    $.toptip(json.returnMsg, 'error');
                }
            }
        };
        $("#ajaxForm").ajaxSubmit(options)
    });
</script>
{/block}